package com.sky.wsp.cas.client.config;

import org.springframework.security.core.userdetails.User;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;

/**
 * @author xin.tu
 */
public class UserDetailServiceImpl implements UserDetailsService {

    @Override
    public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
        System.err.println("=================================loadUserByUsername:" + username);
        // TODO 根据账号，查询用户信息、租户信息、角色权限信息
        UserDetails user = User.withUsername(username).password("").roles("USER").build();
        return user;
    }
}
